package travelDream.beans;

import traveldream.ejb.interfaces.*;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import traveldream.ejb.DTO.HotelDTO;


@ManagedBean(name = "HotelInsertionManaged")
@ViewScoped
public class HotelInsertionManaged {
	
	private HotelDTO hDTO;
	@EJB
	HotelInsertionBeanLocal HotelInsertionBeanLocal;
	
	public HotelInsertionManaged(){
		hDTO = new HotelDTO();
	}
	
	public String insert(){
		HotelInsertionBeanLocal.insert(hDTO);
		return "hotel.xhtml?faces-redirect=true";
	}

	public HotelDTO gethDTO() {
		return hDTO;
	}

	public void sethDTO(HotelDTO hDTO) {
		this.hDTO = hDTO;
	}

	public HotelInsertionBeanLocal getHotelInsertionBeanLocal() {
		return HotelInsertionBeanLocal;
	}

	public void setHotelInsertionBeanLocal(
			HotelInsertionBeanLocal hotelInsertionBeanLocal) {
		HotelInsertionBeanLocal = hotelInsertionBeanLocal;
	}
	
	
}
